Dev_Tasks
Communications Request (COMMREQ) ladder logic instructions instructs the PROFIBUS Master to gather diagnostic or status data and report it to the PLC CPU.
Reference: Series 90-30 PROFIBUS Slave Module User's Manual GFK-2193.
#END#

Get Slave Status
The Get Slave Status COMMREQ retrieves detailed status information for the slave module from the 16-bit slave status word. The starting address of this word is configured as Status/Firmware ID Address in the PROFIBUS Slave module software configuration.
#END#

Read Module Header
The Read Module Header command retrieves Network Diagnostic Information and statistics from the Device.
#END#

Clear Counters
The Clear Counters Command clears the counters in the PROFIBUS Master module to zero.
#END#


Wait_Flag	
PROFIBUS COMMREQs ARE ALWAYS NO WAIT MODE. This flag determines whether PLC will wait until the device serial ports receive the intended data before continuing. The request can either send a message and wait for a reply, or send a message and continue without waiting for a reply. If the Command Block specifies that the program will not wait for a reply, the Command Block contents are sent to the device and ladder program execution resumes immediately. This is referred to as NOWAIT mode. If the Command Block specifies that the program will wait for a reply, the Command Block contents are sent to the targeted device and the CPU waits for a reply for a maximum length of time specified in the Command Block. If the device does not respond in that time, ladder program execution resumes. This is referred to as WAIT mode.
#END#

Idle_Tmout	
The idle timeout value is the maximum time the PLC waits for the device to acknowledge receipt of the request. For NOWAIT, this value is not used. (Any timeout value is ignored; it can be zero.) If WAIT is selected, this word specifies the idle timeout period, in 100-microsecond increments.
#END# 

Max_Comm_Tm	
This word contains the maximum amount of time the program should hold the window open when the device is busy. For NOWAIT, this value is not used. (Any timeout value is ignored; it can be zero.) If WAIT is selected, this word specifies the maximum time in 100 microsecond increments.
#END#

Profibus_Task_Id
Always 1
#END#

Memory_Type_Slave_Status
This and next word specify the location in the PLC where the response will be written.
Get Slave Status - Reply Data Format Response written to location specified by this and next word:
Word 		Name 			Description
Word 1 		Command Code 		Echo of Command code that this data block is replying to (0x0003)
Word 2 		Status Code 		See Word 2 formats in table below
Word 3-10 	Reserved for Future Use 	Word 10 of the command block should specify a minimum of 5 words to accommodate possible future use of this space.
Note: The reply from Get Slave Status contains the same information that is provided to the PLC CPU in the Status/Firmware ID Address. This parameter is defined when the module is configured in the PLC hardware configuration. 
Word 2 - Status Code
Bit 	Meaning 		Value
0-6 	Error Info 	See Network Parameter Errors below
7 	Run/Stop 	0=Stop, 1=Run This is the State of the Profibus Module, it is not the status of the PLC CPU. If the SYS LED is Green the bit=1, if the SYS 				LED is Red or Amber the bit=0 
8 	PLC Cfg 		0= Module configure from PLC CPU is Bad 1=Module configure from PLC CPU is good
9 	On-line 		1=Online module firmware is running
10-11 	Module State 	0=Module is waiting for parameters from Master
			1=Module is waiting for configure from Master
			2=Data Exchange is occurring - normal operation
			3=Error either configure error or module watchdog timeout
12-15 	Baud Rate (bps) 	0=12MBps, 1=6MBps, 2=3MBps, 3=1.5MBps, 4=500KBps, 5=187.5KBps, 6=93.75Bps, 8=19.2KBps, 9=9.6KBps

Network Parameter Errors
The following errors codes may be returned in bits 0-7 in the Get Slave Status reply.
Note: The error code is the numerical value of the bits
Error Code 	Meaning
	0	No error
	1	ID from master does not match Slave ID
	2 	Ready Time from Master does not match Slave Ready time
	3 	Master is requesting Freeze or Sync, which is not supported by the	slave
	4 	Length of data from master to slave is incorrect
	5 	Length of data from slave to master is incorrect
	6 	One of the watchdog factors (SlvWdFact1 or SlvWdFact2) from the master was 0.
	7 	Slave watchdog time out (check response timeout)
	8 	Slave timeout watchdog disabled from master
#END#

Memory_Address
This and previous word specify the location in the PLC where the response will be written. The value entered is the offset (0-based) from the beginning of PLC memory for the memory type and mode specified in previous parameter. This offset will be either in bits, bytes, or words depending on the mode specified (for example, if previous parameter = %I and this parameter = 2, then the starting address will be %I9). Valid ranges of values depend on the PLCs memory ranges.
#END#

Max_Size_Of_Response_Area
Max_Size_Of_Response_Area specifies the size of the memory block for the response. Must be 2 words or more, or an error will be reported in the COMMREQ status and the Get Slave Status request will be ignored.
#END#

Memory_Type_Read_Header
This and next word specify the location in the PLC where the response will be written.
Read Module Header Reply Data Format for Master written to location specified by this and next word:
Word 		Name 			Description
Word 1 		Command Code 		Echo of the Command Code that this data block is replying to (0x0005).
Word 2 		Module Type 		Contains 1 if the module is a Slave and a 2 if the module is a Master.
Word 3 		PfbStatus 		PROFIBUS Status register, also can be read using the Get Device Status COMMREQ.
Word 4 		ModuleVersion 		Module firmware version. 0122h = 1.22
Word 5 		ErrLanOffline 		Counter. LAN went offline due to errors.
Word 6 		DiagConf 		Total confirmations.
Word 7 		DiagInd 			Total indications.
Word 8 		ErrNotOk 		Total not OK confirmations and indications.
Word 9 		DiagSlaveUpdate 		Number of updates the Slave has received from the Master
Word 10 		ErrSlvErr 			Count of Slave Configuration Errors
Word 11 		ErrSlvTout 		Count of Slave Watchdog timeouts (update not received in time)
Word 12 		ErrInvReqLen 		Invalid request length error counter.
Word 13 		ErrFifo 			FIFO overflow error counter.
Word 14 		ErrRxOverun 		Receive overrun error counter.
Word 15 		ErrDblTok 		Double token error counter.
Word 16 		ErrRespErr 		Response error counter.
Word 17 		ErrSynErr 		General network error counter.
Word 18 		ErrNetTout 		Network timeout error counter.
Word 19 		ErrHsa 			Station higher than HAS was heard counter.
Word 20 		ErrStn 			Duplicate station detected counter.
Word 21 		ErrPasTok 		Unable to pass token counter.
Word 22 		ErrLasBad 		Active station list is invalid.
Word 23 		ErrInternal 		Internal errors.
Word 24 		ErrArg 			Argument errors.
Word 25 		ErrEventOverun 		A new event occurred before the last one was cleared.
Note: If the Name starts with Err, the value stops at the maximum. If the Name starts with Diag the count rolls over to zero.
#END#

Max_Size_Of_Response_Area_RH
Response Memory Size specifies the size of the memory block for the response. The Response Memory Size is 25 words. If the Response Memory Size is set smaller than 25, the COMMREQ will fail with a 7 in the COMMREQ Status Word. The user is responsible for assuring that this area is large enough to contain the requested data without overwriting other application data.
#END#

Memory_Type_Clear_Counters
This and next word specify the location in the PLC where the response will be written. 
Clear Counters Reply Data Format written to location specified by this and next word:
Word 		Name 		Description
Word 1 		Command Code 	Echo of Command code that this data block is replying to. (0x0006)
Word 2 		Status Code 	Reports 1 for success and 0 for failure.
#END#

Max_Size_Of_Response_Area_CC
Response Memory Size specifies the size of the memory block for the response. The Response Memory Size is 2 words. If the Response Memory Size (word 10 in the
Clear Counters command block) is set greater than 2, the COMMREQ will succeed. The unneeded memory locations are not written.
#END#
